//
//  HotelViewController.m
//  MiaoTu
//
//  Created by dllo on 16/9/20.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "HotelViewController.h"
#import "ComRes.h"
#import "LocalViewController.h"
#import "LocalHeaderView.h"
#import "UIView+Frame.h"
#import "HotelHeaderCollectionCell.h"
#import "ZWYNetTool.h"
#import "HotelModel.h"
#import "HotelItem.h"
#import "Imagelist.h"
#import "UIImageView+WebCache.h"
#import "MyLayout.h"
#import "Resfacilities.h"
#import "HotelTableCell.h"
#import "Masonry.h"
#import "Prolist.h"
#import "Yueyoulist.h"
#import "MyLocation.h"
#import <CoreLocation/CoreLocation.h>
#import "MapViewController.h"
#import "FacilityView.h"
#import "ZFChooseTimeViewController.h"
#import "SearchViewController.h"
#import "PersonalHomeViewController.h"
#import "LineDetailViewController.h"

#define kHotelHeaderCollectionCell @"HotelHeaderCollectionCellIdentifier"
#define kHotelMapAndDetailTableCell @"HotelMapAndDetailTableCellIdentifier"
#define kHotelTableCell @"HotelTableCellIdentifier"

@interface HotelViewController ()
<
    UICollectionViewDataSource,
    UICollectionViewDelegate,
    UITableViewDataSource,
    UITableViewDelegate
>
@property (nonatomic, strong) UICollectionView *topPicCollection;
@property (nonatomic, strong) HotelItem *hotelItem;
@property (nonatomic, strong) NSArray<Imagelist *> *headerImageArray;
@property (nonatomic, strong) UILabel *headerIndexLabel;
@property (nonatomic, strong) MyBaseLayout *headerRootLayout;
@property (nonatomic, strong) MyRelativeLayout *addressLayout;
@property (nonatomic, strong) UILabel *addressLabel;
@property (nonatomic, strong) UILabel *mapLabel;
@property (nonatomic, strong) UIImageView *mapNextImage;
@property (nonatomic, strong) MyRelativeLayout *facilityLayout;
@property (nonatomic, strong) UILabel *facilityLabel;
@property (nonatomic, strong) UIImageView *showerImage;
@property (nonatomic, strong) UIImageView *wifiImage;
@property (nonatomic, strong) UIImageView *planeImage;
@property (nonatomic, strong) UILabel *detailLabel;
@property (nonatomic, strong) UIImageView *facilityNextImage;
@property (nonatomic, strong) MyRelativeLayout *assembleLayout;
@property (nonatomic, strong) UILabel *togetherLabel;
@property (nonatomic, strong) UIButton *assembleButton;
@property (nonatomic, strong) UILabel *ticketLabel;
@property (nonatomic, strong) UIButton *yueyouButton;
@property (nonatomic, strong) UILabel *yueyouLabel;
@property (nonatomic, strong) MyRelativeLayout *dateLayout;
@property (nonatomic, strong) UILabel *startDateLabel;
@property (nonatomic, strong) UILabel *startWeekDayLabel;
@property (nonatomic, strong) UILabel *endDateLabel;
@property (nonatomic, strong) UILabel *endWeekDayLabel;
@property (nonatomic, strong) UILabel *daysLabel;
@property (nonatomic, strong) UITableView *tableView;
@property (nonatomic, strong) NSArray<Prolist *> *proListArray;
@property (nonatomic, strong) NSMutableArray<NSNumber *> *hiddenStateArray;
@property (nonatomic, strong) MyBaseLayout *footerRootLayout;
@property (nonatomic, strong) UILabel *travelGuideLabel;
@property (nonatomic, strong) UILabel *togetherInfoLabel;
@property (nonatomic, strong) MyRelativeLayout *togetherLayout;
@property (nonatomic, strong) MyRelativeLayout *userLayout;
@property (nonatomic, strong) UIImageView *userHeadImage;
@property (nonatomic, strong) UILabel *userNickName;
@property (nonatomic, strong) UILabel *userTimeAndRangeLabel;
@property (nonatomic, strong) UILabel *userRemark;
@property (nonatomic, strong) FacilityView *facilityHiddenView;
@property (nonatomic, strong) MyBaseLayout *userRemarkLayout;
@end

@implementation HotelViewController

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
    self.tabBarController.tabBar.hidden = YES;
    _facilityHiddenView.alpha = 0;
}


- (void)viewWillDisappear:(BOOL)animated {
    [super viewWillDisappear:animated];
    self.tabBarController.tabBar.hidden = NO;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = [UIColor whiteColor];
    self.automaticallyAdjustsScrollViewInsets = NO;
    
    [self setUpNavigationBar];
    [self createView];
    [self createData];
}

#pragma mark - View
- (void)setUpNavigationBar {
    [self.navigationController.navigationBar setBackgroundImage:[[UIImage alloc] init] forBarMetrics:UIBarMetricsDefault];
    [self.navigationController.navigationBar setShadowImage:[[UIImage alloc] init]];
    
    UIButton *backButton = [UIButton buttonWithType:UIButtonTypeCustom];
    backButton.frame = CGRectMake(0, 0, 36, 36);
    backButton.layer.cornerRadius = 18;
    backButton.layer.masksToBounds = YES;
    backButton.layer.borderColor = [UIColor whiteColor].CGColor;
    backButton.layer.borderWidth = 1;
    backButton.backgroundColor = [UIColor colorWithWhite:0.000 alpha:0.120];
    [backButton setImage:[UIImage imageNamed:@"back"] forState:UIControlStateNormal];
    [backButton addTarget:self action:@selector(backAction) forControlEvents:UIControlEventTouchUpInside];
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:backButton];
}

- (void)createView {
    [self createTableView];
    [self createFacilityHiddenView];
}

- (void)createFacilityHiddenView {
    self.facilityHiddenView = [[FacilityView alloc] initWithFrame:self.view.bounds];
    [self.view addSubview:_facilityHiddenView];
    _facilityHiddenView.alpha = 0;
}

- (void)createTableView {
    self.tableView = [[UITableView alloc] initWithFrame:self.view.bounds style:UITableViewStyleGrouped];
    [self.view addSubview:_tableView];
    _tableView.dataSource = self;
    _tableView.delegate = self;
    [_tableView registerNib:[UINib nibWithNibName:@"HotelTableCell" bundle:[NSBundle mainBundle]] forCellReuseIdentifier:kHotelTableCell];
    _tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
    _tableView.backgroundColor = [UIColor whiteColor];
    _tableView.showsHorizontalScrollIndicator = NO;
    _tableView.showsVerticalScrollIndicator = NO;
    
    [self createTableHeaderLayout];
    [self createTableFooterLayout];
}

- (void)createTableFooterLayout {
    self.footerRootLayout = [MyLinearLayout linearLayoutWithOrientation:MyLayoutViewOrientation_Vert];
    _footerRootLayout.frame = CGRectMake(0, 0, CGRectGetWidth(self.tableView.bounds), 0);
    _footerRootLayout.myRightMargin = _footerRootLayout.myLeftMargin = 0;
//    _footerRootLayout.backgroundColor = [UIColor yellowColor];
    _footerRootLayout.wrapContentHeight = YES;
    _footerRootLayout.padding = UIEdgeInsetsMake(0, 0, 0, 0);
    
    UILabel *policyLabel = [UILabel new];
    [_footerRootLayout addSubview:policyLabel];
    policyLabel.myLeftMargin = 10;
    policyLabel.myTopMargin = 15;
    policyLabel.text = @"酒店政策";
    policyLabel.font = [UIFont systemFontOfSize:19.f];
    [policyLabel sizeToFit];
    
    self.travelGuideLabel = [UILabel new];
    [_footerRootLayout addSubview:_travelGuideLabel];
    _travelGuideLabel.myTopMargin = 10;
    _travelGuideLabel.myLeftMargin = policyLabel.myLeftMargin;
    _travelGuideLabel.myRightMargin = 10;
    _travelGuideLabel.flexedHeight = YES;
    _travelGuideLabel.numberOfLines = 0;
    
    UIView *guideLineView = [UIView new];
    [_footerRootLayout addSubview:guideLineView];
    guideLineView.myTopMargin = 10;
    guideLineView.myLeftMargin = guideLineView.myRightMargin = 0;
    guideLineView.myHeight = 2;
    guideLineView.backgroundColor = [UIColor colorWithWhite:0.886 alpha:1.000];
    
    UIButton *showGuideButton = [UIButton new];
    [_footerRootLayout addSubview:showGuideButton];
    showGuideButton.myLeftMargin = showGuideButton.myRightMargin = 0;
    showGuideButton.myHeight = 45;
    [showGuideButton setTitle:@"查看全部政策" forState:UIControlStateNormal];
    [showGuideButton setTitleColor:[UIColor colorWithWhite:0.522 alpha:1.000] forState:UIControlStateNormal];
    [showGuideButton addTarget:self action:@selector(showGuideLabel) forControlEvents:UIControlEventTouchUpInside];
    
    [self createAlertLayout];
    [self createTogetherLayout];
    [self createUserLayout];
    
    [_footerRootLayout layoutIfNeeded];
    self.tableView.tableFooterView = _footerRootLayout;
}

- (void)createUserLayout {
    self.userLayout = [MyRelativeLayout new];
    [_footerRootLayout addSubview:_userLayout];
    _userLayout.myLeftMargin = _userLayout.myRightMargin = 0;
    _userLayout.padding = UIEdgeInsetsMake(10, 10, 10, 10);
    _userLayout.wrapContentHeight = YES;
//    _userLayout.backgroundColor = [UIColor greenColor];
    
    self.userHeadImage = [UIImageView new];
    [_userLayout addSubview:_userHeadImage];
    _userHeadImage.myHeight = _userHeadImage.myWidth = 40;
    _userHeadImage.layer.cornerRadius = 20;
    _userHeadImage.layer.masksToBounds = 20;
    
    self.userNickName = [UILabel new];
    [_userLayout addSubview:_userNickName];
    _userNickName.leftPos.equalTo(_userHeadImage.rightPos).offset(15);
    _userNickName.font = [UIFont systemFontOfSize:19.f];
    
    self.userTimeAndRangeLabel = [UILabel new];
    [_userLayout addSubview:_userTimeAndRangeLabel];
    _userTimeAndRangeLabel.leftPos.equalTo(_userNickName.leftPos);
    _userTimeAndRangeLabel.topPos.equalTo(_userNickName.bottomPos).offset(8);
    _userTimeAndRangeLabel.font = [UIFont systemFontOfSize:15];
    _userTimeAndRangeLabel.textColor = [UIColor colorWithWhite:0.659 alpha:1.000];
    
    UITapGestureRecognizer *tapUser = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapAction:)];
    [_userLayout addGestureRecognizer:tapUser];
    
    
    self.userRemarkLayout = [MyRelativeLayout new];
    [_footerRootLayout addSubview:_userRemarkLayout];
    _userRemarkLayout.myLeftMargin = _userRemarkLayout.myRightMargin = 0;
    _userRemarkLayout.padding = UIEdgeInsetsMake(10, 10, 10, 10);
    _userRemarkLayout.wrapContentHeight = YES;
    
    self.userRemark = [UILabel new];
    [_userRemarkLayout addSubview:_userRemark];
    _userRemark.myLeftMargin = _userHeadImage.myLeftMargin;
    _userRemark.myRightMargin = 0;
    _userRemark.numberOfLines = 0;
    _userRemark.flexedHeight = YES;
    
    UITapGestureRecognizer *tapUserRemark = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapAction:)];
    [_userRemarkLayout addGestureRecognizer:tapUserRemark];
}

- (void)createAlertLayout {
    MyLinearLayout *alertLayout = [MyLinearLayout linearLayoutWithOrientation:MyLayoutViewOrientation_Vert];
    [_footerRootLayout addSubview:alertLayout];
    alertLayout.backgroundColor = [UIColor colorWithWhite:0.925 alpha:1.000];
    alertLayout.myLeftMargin = alertLayout.myRightMargin = 0;
    alertLayout.wrapContentHeight = YES;
    
    UILabel *alertLabel = [UILabel new];
    [alertLayout addSubview:alertLabel];
    alertLabel.myTopMargin = 20;
    alertLabel.myLeftMargin = 10;
    alertLabel.text = @"特别提醒:";
    alertLabel.font = [UIFont systemFontOfSize:19.f];
    [alertLabel sizeToFit];
    
    UILabel *alertContent = [UILabel new];
    [alertLayout addSubview:alertContent];
    alertContent.myLeftMargin = alertLabel.myLeftMargin;
    alertContent.myRightMargin = alertContent.myLeftMargin;
    alertContent.myTopMargin = 15;
    alertContent.myBottomMargin = 20;
    alertContent.numberOfLines = 0;
    alertContent.flexedHeight = YES;
    alertContent.text = @"1.酒店来自第三方供应商,请凭供应商发送的短信至酒店前台办理入住\n2.预订酒店订单确认后,不可变更/取消";
    [alertContent sizeToFit];
    
}

- (void)createTogetherLayout {
    self.togetherLayout = [MyRelativeLayout new];
    [_footerRootLayout addSubview:_togetherLayout];
    _togetherLayout.myLeftMargin = _togetherLayout.myRightMargin = 0;
    _togetherLayout.wrapContentHeight = YES;
    _togetherLayout.padding = UIEdgeInsetsMake(10, 0, 10, 0);
    
    UILabel *togetherLabel = [UILabel new];
    [_togetherLayout addSubview:togetherLabel];
    togetherLabel.myCenterXOffset = _footerRootLayout.myCenterXOffset;
    togetherLabel.font = [UIFont systemFontOfSize:20];
    togetherLabel.text = @"去结伴";
    [togetherLabel sizeToFit];
    
    UIImageView *nextImage = [UIImageView new];
    [_togetherLayout addSubview:nextImage];
    nextImage.topPos.equalTo(togetherLabel.bottomPos);
    nextImage.leftPos.equalTo(togetherLabel.rightPos).offset(100);
    nextImage.myHeight = nextImage.myWidth = 15;
    nextImage.image = [UIImage imageNamed:@"cell_next"];
    [nextImage sizeToFit];
    
    self.togetherInfoLabel = [UILabel new];
    [_togetherLayout addSubview:_togetherInfoLabel];
    _togetherInfoLabel.centerXPos.equalTo(_togetherLayout.centerXPos);
    _togetherInfoLabel.topPos.equalTo(togetherLabel.bottomPos).offset(15);
    
    UITapGestureRecognizer *tapTogether = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapAction:)];
    [_togetherLayout addGestureRecognizer:tapTogether];
    
    UIView *togetherLineView = [UIView new];
    [_footerRootLayout addSubview:togetherLineView];
    togetherLineView.myTopMargin = 8;
    togetherLineView.myLeftMargin = togetherLineView.myRightMargin = 0;
    togetherLineView.myHeight = 2;
    togetherLineView.backgroundColor = [UIColor colorWithWhite:0.886 alpha:1.000];
}

- (void)createTableHeaderLayout {
    self.headerRootLayout = [MyLinearLayout linearLayoutWithOrientation:MyLayoutViewOrientation_Vert];
    _headerRootLayout.frame = CGRectMake(0, 0, CGRectGetWidth(self.tableView.bounds), 0);
    _headerRootLayout.wrapContentHeight = YES;
    _headerRootLayout.padding = UIEdgeInsetsMake(0, 0, 0, 0);
    
    [self createTopPicCollection];
    [self createAddressLayout];
    [self createFacilityLayout];
    [self createAssembleLayout];
    [self createDateLayout];

    [_headerRootLayout layoutIfNeeded];
    self.tableView.tableHeaderView = _headerRootLayout;
    
}

- (void)createTopPicCollection {
    UICollectionViewFlowLayout *fl = [[UICollectionViewFlowLayout alloc] init];
    fl.scrollDirection = UICollectionViewScrollDirectionHorizontal;
    fl.itemSize = CGSizeMake(self.view.dk_width, 210);
    fl.minimumInteritemSpacing = 0;
    fl.minimumLineSpacing = 0;
    self.topPicCollection = [[UICollectionView alloc] initWithFrame:CGRectMake(0, 0, self.view.dk_width, 210) collectionViewLayout:fl];
    [_headerRootLayout addSubview:_topPicCollection];
    _topPicCollection.backgroundColor = [UIColor whiteColor];
    _topPicCollection.dataSource = self;
    _topPicCollection.delegate = self;
    [_topPicCollection registerNib:[UINib nibWithNibName:@"HotelHeaderCollectionCell" bundle:[NSBundle mainBundle]] forCellWithReuseIdentifier:kHotelHeaderCollectionCell];
    _topPicCollection.pagingEnabled = YES;
    _topPicCollection.showsHorizontalScrollIndicator = NO;
    _topPicCollection.showsVerticalScrollIndicator = NO;
}

- (void)createAddressLayout {
    self.addressLayout = [MyRelativeLayout new];
    _addressLayout.myLeftMargin = _addressLayout.myRightMargin = 0;
    _addressLayout.myHeight = 58;
    _addressLayout.padding = UIEdgeInsetsMake(10, 10, 10, 10);
    [_headerRootLayout addSubview:_addressLayout];
    
    self.addressLabel = [UILabel new];
    _addressLabel.myLeftMargin = 0;
    _addressLabel.myCenterYOffset = _addressLayout.myCenterYOffset;
    [_addressLayout addSubview:_addressLabel];
    _addressLabel.font = [UIFont systemFontOfSize:19.f];
    
    self.mapNextImage = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"cell_next"]];
    [_addressLayout addSubview:_mapNextImage];
    _mapNextImage.myRightMargin = 0;
    _mapNextImage.myCenterYOffset = _addressLabel.myCenterYOffset;
    _mapNextImage.myHeight = _mapNextImage.myWidth = 20;
    
    self.mapLabel = [UILabel new];
    [_addressLayout addSubview:_mapLabel];
    _mapLabel.rightPos.equalTo(_mapNextImage.leftPos);
    _mapLabel.myCenterYOffset = _mapNextImage.myCenterYOffset;
    _mapLabel.text = @"地图";
    [_mapLabel sizeToFit];
    _mapLabel.textColor = [UIColor colorWithWhite:0.510 alpha:1.000];    
    _addressLabel.rightPos.equalTo(_mapLabel.leftPos).offset(20);
    
    UIView *mapLineView = [UIView new];
    [_headerRootLayout addSubview:mapLineView];
    mapLineView.myLeftMargin = 10;
    mapLineView.myRightMargin = 0;
    mapLineView.myHeight = 1;
    mapLineView.backgroundColor = [UIColor colorWithWhite:0.851 alpha:1.000];
    
    UIGestureRecognizer *tapAddress = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapAction:)];
    [_addressLayout addGestureRecognizer:tapAddress];
}

- (void)createFacilityLayout {
    self.facilityLayout = [MyRelativeLayout new];
    _facilityLayout.myLeftMargin = _facilityLayout.myRightMargin = 0;
    _facilityLayout.wrapContentHeight = YES;
    _facilityLayout.padding = UIEdgeInsetsMake(10, 10, 10, 10);
    [_headerRootLayout addSubview:_facilityLayout];
    
    self.facilityLabel = [UILabel new];
    _facilityLabel.myTopMargin = 10;
    _facilityLabel.myLeftMargin = 0;
    _facilityLabel.text = @"酒店基本设施";
    _facilityLabel.font = [UIFont systemFontOfSize:19.f];
    [_facilityLayout addSubview:_facilityLabel];
    [_facilityLabel sizeToFit];
    
    self.showerImage = [UIImageView new];
    _showerImage.topPos.equalTo(_facilityLabel.bottomPos).offset(5);
    _showerImage.myLeftMargin = 0;
    _showerImage.myHeight = _showerImage.myWidth = 20;
    [_facilityLayout addSubview:_showerImage];
    _showerImage.image = [UIImage imageNamed:@"shower"];
    
    self.wifiImage = [UIImageView new];
    _wifiImage.topPos.equalTo(_showerImage.topPos);
    _wifiImage.leftPos.equalTo(_showerImage.rightPos).offset(5);
    _wifiImage.myHeight = _wifiImage.myWidth = 20;
    [_facilityLayout addSubview:_wifiImage];
    _wifiImage.image = [UIImage imageNamed:@"wifi"];
    
    self.planeImage = [UIImageView new];
    _planeImage.topPos.equalTo(_facilityLabel.bottomPos).offset(5);
    _planeImage.leftPos.equalTo(_wifiImage.rightPos).offset(5);
    _planeImage.myHeight = _planeImage.myWidth = 20;
    [_facilityLayout addSubview:_planeImage];
    _planeImage.image = [UIImage imageNamed:@"plane"];
    
    self.facilityNextImage = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"cell_next"]];
    [_facilityLayout addSubview:_facilityNextImage];
    _facilityNextImage.myWidth = _facilityNextImage.myHeight = 20;
    _facilityNextImage.myRightMargin = 0;
    _facilityNextImage.myCenterYOffset = _facilityLayout.myCenterYOffset;
    
    self.detailLabel = [UILabel new];
    [_facilityLayout addSubview:_detailLabel];
    _detailLabel.rightPos.equalTo(_facilityNextImage.leftPos);
    _detailLabel.myCenterYOffset = _facilityLayout.myCenterYOffset;
    _detailLabel.text = @"详情";
    [_detailLabel sizeToFit];
    _detailLabel.textColor = [UIColor colorWithWhite:0.522 alpha:1.000];
    
    _showerImage.hidden = YES;
    _wifiImage.hidden = YES;
    _planeImage.hidden = YES;
    
    UIView *facilityLineView = [UIView new];
    facilityLineView.myLeftMargin = facilityLineView.myRightMargin = 0;
    facilityLineView.myHeight = 4;
    facilityLineView.backgroundColor = [UIColor colorWithWhite:0.925 alpha:1.000];
    [_headerRootLayout addSubview:facilityLineView];

    UITapGestureRecognizer *tapFacility = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapAction:)];
    [_facilityLayout addGestureRecognizer:tapFacility];
}

- (void)createAssembleLayout {
    self.assembleLayout = [MyRelativeLayout new];
    _assembleLayout.myLeftMargin = _assembleLayout.myRightMargin = 0;
    _assembleLayout.padding = UIEdgeInsetsMake(20, 20, 10, 20);
    _assembleLayout.wrapContentHeight = YES;
    [_headerRootLayout addSubview:_assembleLayout];
    
    self.togetherLabel = [UILabel new];
    [_assembleLayout addSubview:_togetherLabel];
    _togetherLabel.myCenterXOffset = _assembleLayout.myCenterXOffset;
    _togetherLabel.topPos.equalTo(_assembleLayout.topPos);
    
    self.assembleButton = [UIButton new];
    [_assembleLayout addSubview:_assembleButton];
    _assembleButton.topPos.equalTo(_togetherLabel.bottomPos).offset(10);
    _assembleButton.myLeftMargin = 0;
    _assembleButton.myHeight = 52;
    _assembleButton.layer.borderWidth = 1;
    _assembleButton.layer.borderColor = [UIColor colorWithRed:0.910 green:0.310 blue:0.098 alpha:1.000].CGColor;
    [_assembleButton setTitleColor:[UIColor colorWithRed:0.910 green:0.310 blue:0.098 alpha:1.000] forState:UIControlStateNormal];
    _assembleButton.layer.cornerRadius = 26;
    _assembleButton.layer.masksToBounds = YES;
    [_assembleButton addTarget:self action:@selector(setAssemblePlace) forControlEvents:UIControlEventTouchUpInside];
    
    self.yueyouButton = [UIButton new];
    [_assembleLayout addSubview:_yueyouButton];
    _yueyouButton.topPos.equalTo(_togetherLabel.bottomPos).offset(10);
    _yueyouButton.myRightMargin = 0;
    _yueyouButton.myHeight = 52;
    _yueyouButton.layer.borderWidth = 1;
    _yueyouButton.layer.borderColor = [UIColor colorWithRed:0.910 green:0.310 blue:0.098 alpha:1.000].CGColor;
    [_yueyouButton setTitleColor:[UIColor colorWithRed:0.910 green:0.310 blue:0.098 alpha:1.000] forState:UIControlStateNormal];
    _yueyouButton.layer.cornerRadius = 26;
    _yueyouButton.layer.masksToBounds = YES;
    _assembleButton.widthDime.equalTo(@[_yueyouButton.widthDime.add(-20)]);
    [_yueyouButton addTarget:self action:@selector(launchYueyou) forControlEvents:UIControlEventTouchUpInside];
    
    self.ticketLabel = [UILabel new];
    [_assembleLayout addSubview:_ticketLabel];
    _ticketLabel.centerXPos.equalTo(_assembleButton.centerXPos);
    _ticketLabel.topPos.equalTo(_assembleButton.bottomPos).offset(10);
    _ticketLabel.font = [UIFont systemFontOfSize:15.f];
    _ticketLabel.textColor = [UIColor colorWithWhite:0.608 alpha:1.000];
    
    self.yueyouLabel = [UILabel new];
    [_assembleLayout addSubview:_yueyouLabel];
    _yueyouLabel.centerXPos.equalTo(_yueyouButton.centerXPos);
    _yueyouLabel.topPos.equalTo(_yueyouButton.bottomPos).offset(10);
    _yueyouLabel.font = [UIFont systemFontOfSize:15.f];
    _yueyouLabel.textColor = [UIColor colorWithWhite:0.608 alpha:1.000];
    
    UIView *assembleLineView = [UIView new];
    assembleLineView.myLeftMargin = assembleLineView.myRightMargin = 0;
    assembleLineView.myHeight = 4;
    assembleLineView.backgroundColor = [UIColor colorWithWhite:0.925 alpha:1.000];
    [_headerRootLayout addSubview:assembleLineView];
}

- (void)createDateLayout {
    MyRelativeLayout *merchantLayout = [MyRelativeLayout new];
    merchantLayout.myLeftMargin = merchantLayout.myRightMargin = 0;
    merchantLayout.wrapContentHeight = YES;
    merchantLayout.padding = UIEdgeInsetsMake(20, 20, 0, 20);
    [_headerRootLayout addSubview:merchantLayout];
    
    UILabel *merchantLabel = [UILabel new];
    merchantLabel.myLeftMargin = merchantLayout.myTopMargin = 0;
    merchantLabel.text = @"商户";
    [merchantLayout addSubview:merchantLabel];
    merchantLabel.font = [UIFont systemFontOfSize:19.f];
    [merchantLabel sizeToFit];
    
    UILabel *discountLabel = [UILabel new];
    discountLabel.centerYPos.equalTo(merchantLabel.centerYPos);
    discountLabel.leftPos.equalTo(merchantLabel.rightPos).offset(10);
    discountLabel.text = @"(拼房费用减半)";
    discountLabel.textColor = [UIColor colorWithWhite:0.541 alpha:1.000];
    [merchantLayout addSubview:discountLabel];
    [discountLabel sizeToFit];
    
    UILabel *travelLabel = [UILabel new];
    travelLabel.myRightMargin = merchantLayout.myRightMargin;
    travelLabel.centerYPos.equalTo(merchantLabel.centerYPos);
    travelLabel.text = @"同程旅游";
    [merchantLayout addSubview:travelLabel];
    travelLabel.font = [UIFont systemFontOfSize:19.f];
    [travelLabel sizeToFit];
    
    UIView *merchantLineView = [UIView new];
    merchantLineView.myRightMargin = merchantLineView.myLeftMargin = -20;
    merchantLineView.myHeight = 2;
    merchantLineView.topPos.equalTo(merchantLabel.bottomPos).offset(20);
    merchantLineView.backgroundColor = [UIColor colorWithWhite:0.859 alpha:1.000];
    [merchantLayout addSubview:merchantLineView];
   
    self.dateLayout = [MyRelativeLayout new];
    _dateLayout.myRightMargin = _dateLayout.myLeftMargin = -20;
    _dateLayout.myHeight = 70;
    _dateLayout.topPos.equalTo(merchantLineView.bottomPos).offset(10);
//    _dateLayout.backgroundColor = [UIColor greenColor];
    [_headerRootLayout addSubview:_dateLayout];

    UILabel *checkInLabel = [UILabel new];
    checkInLabel.myTopMargin = checkInLabel.myLeftMargin = 0;
    checkInLabel.widthDime.equalTo(_dateLayout.widthDime).multiply(0.5).add(-1);
    checkInLabel.text = @"入住";
    [checkInLabel sizeToFit];
    checkInLabel.textAlignment = NSTextAlignmentCenter;
    [_dateLayout addSubview:checkInLabel];
    
    UILabel *checkoutLabel = [UILabel new];
    checkoutLabel.myTopMargin = checkoutLabel.myRightMargin = 0;
    checkoutLabel.widthDime.equalTo(checkInLabel.widthDime);
    checkoutLabel.heightDime.equalTo(checkInLabel.heightDime);
    [_dateLayout addSubview:checkoutLabel];
    checkoutLabel.text = @"退房";
    checkoutLabel.textAlignment = NSTextAlignmentCenter;
    
    UIView *checkTopLineView = [UIView new];
    checkTopLineView.centerYPos.equalTo(checkInLabel.centerYPos);
    checkTopLineView.myHeight = 10;
    checkTopLineView.myWidth = 2;
    checkTopLineView.leftPos.equalTo(checkInLabel.rightPos);
    [_dateLayout addSubview:checkTopLineView];
    checkTopLineView.backgroundColor = [UIColor colorWithWhite:0.878 alpha:1.000];
    
    self.startDateLabel = [UILabel new];
    [_dateLayout addSubview:_startDateLabel];
    _startDateLabel.centerXPos.equalTo(checkInLabel.centerXPos);
    _startDateLabel.topPos.equalTo(checkInLabel.bottomPos).offset(10);
    _startDateLabel.textColor = [UIColor colorWithRed:0.298 green:0.722 blue:1.000 alpha:1.000];
    self.startWeekDayLabel = [UILabel new];
    [_dateLayout addSubview:_startWeekDayLabel];
    _startWeekDayLabel.leftPos.equalTo(_startDateLabel.rightPos).offset(5);
    _startWeekDayLabel.bottomPos.equalTo(_startDateLabel.bottomPos);
    _startWeekDayLabel.textColor = [UIColor colorWithRed:0.298 green:0.722 blue:1.000 alpha:1.000];
    _startWeekDayLabel.font = [UIFont systemFontOfSize:13.f];
    
    self.endDateLabel = [UILabel new];
    [_dateLayout addSubview:_endDateLabel];
    _endDateLabel.centerXPos.equalTo(checkoutLabel.centerXPos);
    _endDateLabel.topPos.equalTo(_startDateLabel.topPos);
    _endDateLabel.textColor = [UIColor colorWithRed:0.298 green:0.722 blue:1.000 alpha:1.000];
    self.endWeekDayLabel = [UILabel new];
    [_dateLayout addSubview:_endWeekDayLabel];
    _endWeekDayLabel.leftPos.equalTo(_endDateLabel.rightPos).offset(5);
    _endWeekDayLabel.bottomPos.equalTo(_endDateLabel.bottomPos);
    _endWeekDayLabel.textColor = [UIColor colorWithRed:0.298 green:0.722 blue:1.000 alpha:1.000];
    _endWeekDayLabel.font = [UIFont systemFontOfSize:13.f];
    
    self.daysLabel = [UILabel new];
    [_dateLayout addSubview:_daysLabel];
    _daysLabel.myCenterXOffset = checkTopLineView.myCenterXOffset;
    _daysLabel.topPos.equalTo(checkTopLineView.bottomPos).offset(5);
    _daysLabel.textColor = [UIColor colorWithWhite:0.322 alpha:1.000];
    
    UILabel *checkBottomLineView = [UILabel new];
    [_dateLayout addSubview:checkBottomLineView];
    checkBottomLineView.topPos.equalTo(_daysLabel.bottomPos).offset(5);
    checkBottomLineView.myHeight = checkTopLineView.myHeight;
    checkBottomLineView.myWidth = checkTopLineView.myWidth;
    checkBottomLineView.myCenterXOffset = checkTopLineView.myCenterXOffset;
    checkBottomLineView.backgroundColor = checkTopLineView.backgroundColor;

    UITapGestureRecognizer *tapDataLayout = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapAction:)];
    [_dateLayout addGestureRecognizer:tapDataLayout];
    
    UIView *dateLineView = [UIView new];
    dateLineView.myRightMargin = dateLineView.myLeftMargin = -20;
    dateLineView.myHeight = 2;
    dateLineView.topPos.equalTo(_dateLayout.bottomPos);
    dateLineView.backgroundColor = [UIColor colorWithWhite:0.859 alpha:1.000];
    [_headerRootLayout addSubview:dateLineView];
    
}

#pragma mark - Data
- (void)createData {
    LocalViewController *localVC = self.navigationController.viewControllers.firstObject;
    NSString *startAndEndDate = localVC.headerView.startAndEndDate;
    NSArray *startAndEndArray = [startAndEndDate componentsSeparatedByString:@" "];
    NSString *startDateStr = startAndEndArray.firstObject;
    NSString *endDateStr = startAndEndArray.lastObject;
    _startDateLabel.text = [startDateStr substringFromIndex:5];
    [_startDateLabel sizeToFit];
    _endDateLabel.text = [endDateStr substringFromIndex:5];
    [_endDateLabel sizeToFit];
    
    NSDateFormatter *df = [NSDateFormatter new];
    [df setDateFormat:@"yyyy-MM-dd"];
    NSDate *startDate = [df dateFromString:startDateStr];
    NSDate *endDate = [df dateFromString:endDateStr];
    
    NSCalendar *calendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSCalendarIdentifierGregorian];
    NSDateComponents *startComps = [calendar components:NSCalendarUnitWeekday fromDate:startDate];
    NSDateComponents *endComps = [calendar components:NSCalendarUnitWeekday fromDate:endDate];
    NSArray *weekdayArray = @[@"0", @"周日", @"周一", @"周二", @"周三", @"周四", @"周五", @"周六"];
    _startWeekDayLabel.text = weekdayArray[startComps.weekday];
    [_startWeekDayLabel sizeToFit];
    _endWeekDayLabel.text = weekdayArray[endComps.weekday];
    [_endWeekDayLabel sizeToFit];
    
    NSDateComponents *comps = [calendar components:NSCalendarUnitDay fromDate:startDate toDate:endDate options:NSCalendarWrapComponents];
    _daysLabel.text = [NSString stringWithFormat:@"共%zd晚", comps.day];
    [_daysLabel sizeToFit];
    
    NSString *urlString = [NSString stringWithFormat:@"http://api.miaotu.net/v2/res/details?token=&begin_date=%@&end_date=%@&com_id=%zd", startDateStr, endDateStr,_comRes.ComId];
    NSDictionary *headerDic = @{@"User-Agent":@"Dalvik/1.6.0 (Linux; U; Android 4.3; R6007 Build/JLS36C) Paros/3.2.13", @"Host":@"api.miaotu.net", @"Connection":@"Keep-Alive"};
    [ZWYNetTool GET:urlString andBody:nil andHeader:headerDic andResponse:ZWYJSON andSuccessBlock:^(id result) {
        HotelModel *hotelModel = [HotelModel modelWithDic:result];
        self.hotelItem = hotelModel.Items;
        [self setData];
    } andFailureBlock:^(NSError *error) {
        
    }];
}

- (void)setData {
    // setHeaderData
    self.headerImageArray = _hotelItem.ImageList;
    [_topPicCollection reloadData];
    _addressLabel.text = _hotelItem.Address;
    [_addressLabel sizeToFit];
    NSArray<Resfacilities *> *facilityArray = _hotelItem.ResFacilities;
    for (Resfacilities *facility in facilityArray) {
        if ([facility.FacilityServicesName isEqualToString:@"独立卫浴"]) {
            _showerImage.hidden = NO;
        }
        if ([facility.FacilityServicesName isEqualToString:@"免费WIFI"]) {
            _wifiImage.hidden = NO;
        }
        if ([facility.FacilityServicesName isEqualToString:@"接机服务"]) {
            _showerImage.hidden = NO;
        }
    }
    _togetherLabel.text = [NSString stringWithFormat:@"已有%zd人在此结伴", _hotelItem.YueyouCount];
    [_togetherLabel sizeToFit];
    
    if (_hotelItem.IsCom) {
        [_assembleButton setTitle:@"已设为集合地" forState:UIControlStateNormal];
        _ticketLabel.text = @"设置成功";
    } else {
        [_assembleButton setTitle:@"设为集合地" forState:UIControlStateNormal];
        _ticketLabel.text = @"设置即送10元旅行基金券";
    }
    [_ticketLabel sizeToFit];
    
    [_yueyouButton setTitle:@"发约游" forState:UIControlStateNormal];
    if (_hotelItem.IsYueyou) {
        _yueyouLabel.text = @"抵用券已领";
    } else {
        _yueyouLabel.text = @"发起即获得15元基金券";
    }
    [_yueyouLabel sizeToFit];
    
    
    // setFooterData
    _travelGuideLabel.text = _hotelItem.TravelGuide;
    [_travelGuideLabel sizeToFit];
    
    _togetherInfoLabel.text = [NSString stringWithFormat:@"%@有%zd条结伴信息", _hotelItem.RecommendCity, _hotelItem.RecommendCount];
    [_togetherInfoLabel sizeToFit];
    
    Yueyoulist *yueYou = _hotelItem.YueyouList.firstObject;
    [_userHeadImage sd_setImageWithURL:[NSURL URLWithString:yueYou.HeadUrl]];
    [_userHeadImage sizeToFit];
    _userNickName.text = yueYou.Nickname;
    [_userNickName sizeToFit];
    
    NSMutableString *timeAndRangeString = [NSMutableString string];
    NSDateFormatter *sourceDf = [NSDateFormatter new];
    [sourceDf setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
    NSDate *sourceDate = [sourceDf dateFromString:yueYou.Created];
    NSDateFormatter *destinationDf = [NSDateFormatter new];
    [destinationDf setDateFormat:@"M月dd日 HH:mm"];
    NSString *destinationDateString = [destinationDf stringFromDate:sourceDate];
    [timeAndRangeString appendString:destinationDateString];
    [timeAndRangeString appendFormat:@" | %.2lfkm", yueYou.Distance];
    _userTimeAndRangeLabel.text = timeAndRangeString;
    [_userTimeAndRangeLabel sizeToFit];
    _userRemark.text = yueYou.Remark;
    [_userRemark sizeToFit];
    
    [_footerRootLayout layoutIfNeeded];
    [_headerRootLayout layoutIfNeeded];
    [_tableView beginUpdates];
    _tableView.tableHeaderView = _headerRootLayout;
    _tableView.tableFooterView = _footerRootLayout;
    [_tableView endUpdates];
    
    self.proListArray = _hotelItem.ProList;
    // 隐藏显示状态的数组
    self.hiddenStateArray = [NSMutableArray array];
    NSNumber *ishidden = [NSNumber numberWithBool:YES];
    for (NSInteger i = 0; i < _proListArray.count; i++) {
        [_hiddenStateArray addObject:ishidden];
    }
    if (_hiddenStateArray.count > 0) {
        [_hiddenStateArray replaceObjectAtIndex:0 withObject:[NSNumber numberWithBool:NO]];
    }
    
    [_tableView reloadData];
}



#pragma mark - CollectionView DataSource
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
    return _headerImageArray.count;
}

- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
    HotelHeaderCollectionCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:kHotelHeaderCollectionCell forIndexPath:indexPath];
    cell.titleLabel.text = [NSString stringWithFormat:@"%@ [%@]", _hotelItem.ResName, _hotelItem.ResGrade];
    [cell.picImage sd_setImageWithURL:[NSURL URLWithString:_headerImageArray[indexPath.item].ImageUrl] placeholderImage:[UIImage imageNamed:@"placeholderImage"]];
    cell.picIndexLabel.text = [NSString stringWithFormat:@"%zd/%zd", indexPath.item + 1, _headerImageArray.count];
    return cell;
}

#pragma mark - TableView DataSource
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    return _proListArray.count;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    if (_hiddenStateArray[section].boolValue == YES) {
        return 0;
    } else {
        return 1;
    }
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    HotelTableCell *cell = [tableView dequeueReusableCellWithIdentifier:kHotelTableCell forIndexPath:indexPath];
    return cell;
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
    return 80;
}

- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
    Prolist *proList = _proListArray[section];
    
    UIView *headerView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, _tableView.dk_width, 100)];
    UIImageView *roomImage = [UIImageView new];
    [headerView addSubview:roomImage];
    [roomImage mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.left.mas_equalTo(headerView).offset(10);
        make.bottom.mas_equalTo(headerView).offset(-10);
        make.width.mas_equalTo(roomImage.mas_height);
    }];
    [roomImage sd_setImageWithURL:[NSURL URLWithString:proList.ImageUrl]];
    roomImage.layer.cornerRadius = 4;
    roomImage.layer.masksToBounds = YES;
    
    UILabel *proNameLabel = [UILabel new];
    [headerView addSubview:proNameLabel];
    [proNameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(roomImage.mas_top).offset(10);
        make.left.mas_equalTo(roomImage.mas_right).offset(10);
    }];
    proNameLabel.text = proList.ProName;
    
    UIImageView *upImage = [UIImageView new];
    [headerView addSubview:upImage];
    [upImage mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.mas_equalTo(headerView.mas_centerY);
        make.right.mas_equalTo(headerView.mas_right).offset(-10);
        make.width.height.mas_equalTo(15);
    }];
    upImage.tag = section + 600;
    
    if (_hiddenStateArray[section].boolValue == YES) {
        upImage.image = [UIImage imageNamed:@"down"];
    } else {
        upImage.image = [UIImage imageNamed:@"up"];
    }

    UILabel *priceLabel = [UILabel new];
    [headerView addSubview:priceLabel];
    [priceLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.mas_equalTo(upImage.mas_centerY);
        make.right.mas_equalTo(upImage.mas_left).offset(-10);
    }];
    priceLabel.text = @(proList.QuotedPrice).stringValue;
    
    UIView *roomLineView = [UIView new];
    [headerView addSubview:roomLineView];
    [roomLineView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.bottom.mas_equalTo(headerView);
        make.height.mas_equalTo(2);
    }];
    roomLineView.backgroundColor = [UIColor colorWithWhite:0.827 alpha:0.5];
    
    UITapGestureRecognizer *tapHeader = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapHeaderAction:)];
    [headerView addGestureRecognizer:tapHeader];
    headerView.tag = section + 500;
    
    return headerView;
}

- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
    return 80;
}

- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section {
    return 2;
}

#pragma mark - TableView Delegate
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    
}

#pragma mark - Action
- (void)backAction {
    [self.navigationController popViewControllerAnimated:YES];
}

- (void)tapAction:(UITapGestureRecognizer *)tap {
    if (tap.view == _addressLayout) {
        MapViewController *mapVC = [MapViewController new];
        mapVC.addressString = _hotelItem.Address;
        [self.navigationController pushViewController:mapVC animated:YES];
    } else if (tap.view == _facilityLayout) {
        _facilityHiddenView.hotel = _hotelItem;
        [UIView animateWithDuration:0.2 animations:^{
            _facilityHiddenView.alpha = 1;
        }];       
    } else if (tap.view == _dateLayout) {
        
        ZFChooseTimeViewController *calendarVC = [[ZFChooseTimeViewController alloc] init];
        [calendarVC backDate:^(NSArray *goDate, NSArray *backDate) {
            _startDateLabel.text = [NSString stringWithFormat:@"%@-%@", goDate[1], goDate[2]];
            _endDateLabel.text = [NSString stringWithFormat:@"%@-%@", backDate[1], backDate[2]];
            [_startDateLabel sizeToFit];
            [_endDateLabel sizeToFit];
            
            NSString *startDateString = [goDate componentsJoinedByString:@"-"];
            NSString *endDateString = [backDate componentsJoinedByString:@"-"];
            
            NSDateFormatter *df = [NSDateFormatter new];
            [df setDateFormat:@"yyyy-MM-dd"];
            NSDate *startDate = [df dateFromString:startDateString];
            NSDate *endDate = [df dateFromString:endDateString];
            
            NSCalendar *calendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSCalendarIdentifierGregorian];
            NSDateComponents *startComps = [calendar components:NSCalendarUnitWeekday fromDate:startDate];
            NSDateComponents *endComps = [calendar components:NSCalendarUnitWeekday fromDate:endDate];
            NSArray *weekdayArray = @[@"0", @"周日", @"周一", @"周二", @"周三", @"周四", @"周五", @"周六"];
            _startWeekDayLabel.text = weekdayArray[startComps.weekday];
            _endWeekDayLabel.text = weekdayArray[endComps.weekday];
            
            NSDateComponents *comps = [calendar components:NSCalendarUnitDay fromDate:startDate toDate:endDate options:NSCalendarWrapComponents];
            _daysLabel.text = [NSString stringWithFormat:@"%zd晚", comps.day];
            
        }];
        
        [self.navigationController pushViewController:calendarVC animated:YES];
    } else if (tap.view == _togetherLayout) {
        SearchViewController *searchVC = [[SearchViewController alloc] initWithNibName:@"SearchViewController" bundle:[NSBundle mainBundle]];
        searchVC.cityString = _hotelItem.CityName;
        [self presentViewController:searchVC animated:YES completion:^{
            
        }];
    } else if (tap.view == _userLayout) {
        PersonalHomeViewController *personVC = [[PersonalHomeViewController alloc] init];
        personVC.isOtherInfo = YES;
        personVC.Uid = _hotelItem.YueyouList.firstObject.Uid;
        [self.navigationController pushViewController:personVC animated:YES];
    } else if (tap.view == _userRemarkLayout) {
        LineDetailViewController *lineVC = [[LineDetailViewController alloc] init];
        lineVC.yid = _hotelItem.YueyouList.firstObject.Yid;
        [self.navigationController pushViewController:lineVC animated:YES];
    }
}

- (void)orderRoom {
    NSLog(@"order");
}

- (void)setAssemblePlace {
    NSLog(@"设为集合地");
}

- (void)launchYueyou {
    NSLog(@"发约游");
}

- (void)tapHeaderAction:(UITapGestureRecognizer *)tap {
    NSInteger section = tap.view.tag - 500;
    BOOL hiddenState = !_hiddenStateArray[section].boolValue;
    [_hiddenStateArray replaceObjectAtIndex:section withObject:[NSNumber numberWithBool:hiddenState]];
    [_tableView reloadSections:[NSIndexSet indexSetWithIndex:section] withRowAnimation:UITableViewRowAnimationAutomatic];
    
    NSInteger imageTag = 600 + section;
    UIImageView *imageView = [self.view viewWithTag:imageTag];
    if (hiddenState == YES) {
        imageView.image = [UIImage imageNamed:@"up"];
    } else {
        imageView.image = [UIImage imageNamed:@"down"];
    }
    
}

- (void)showGuideLabel {

    NSLog(@"guide");
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
